<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>

<chiptrack:checkLogon sourcePage="/financeReport.do?action=product" />

<HTML><HEAD>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<SCRIPT language="JavaScript" src="<%=chipTracContext%>/jsp/includes/scripts/validations.js">
</script>
<SCRIPT language="JavaScript">
var dateElement = "";
function openCalendar(dateValue)
{
	dateElement = dateValue;
	newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
	newWindow.moveTo(550,180);
	newWindow.focus();
}

function cancelAndGoBack() 
{
	document.location = "jsp/finance/finance.jsp";
}
	
function assignDate(passedValue)
{
	dateElement.value=passedValue;
	window.focus();
}

function finance()
{
    document.costReportForm.prompt1.value = document.costReportForm.fromdate.value;
    document.costReportForm.prompt2.value = document.costReportForm.todate.value;

    if(document.costReportForm.prompt1.value=='')
        document.costReportForm.prompt1.value = '01/01/1900';

    if(document.costReportForm.prompt2.value=='')
        document.costReportForm.prompt2.value = '01/01/9999';

	for (counter = 0; counter < document.costReportForm.groupBy.length; counter++)
	{
		if (document.costReportForm.groupBy[counter].checked)
		{
			document.costReportForm.prompt3.value = document.costReportForm.groupBy[counter].value;
		}
	}

	for (counter = 0; counter < document.costReportForm.reportType.length; counter++)
	{
		if (document.costReportForm.reportType[counter].checked)
		{
			document.costReportForm.selectedReportType.value = document.costReportForm.reportType[counter].value;
		}
	}

	/*alert( document.costReportForm.prompt0.value );
	alert( document.costReportForm.prompt1.value );
	alert( document.costReportForm.prompt2.value );
	alert( document.costReportForm.prompt3.value );
	alert( document.costReportForm.selectedReportType.value );*/

	//added by varma(29jun2004) to validate from and to dates
    var errors = "";
    temp = document.costReportForm["todate"];
    if( chkDate(document.costReportForm["todate"].value,"","Y") && chkDate(temp.value,"","N") && document.costReportForm["todate"].value != '' )
    {
       if( CompareDate( document.costReportForm["fromdate"].value, document.costReportForm["todate"].value ) == false )
       {
         errors = errors + " To Date Cannot be less than From Date";
         var pa = document.getElementById("errors");
         pa.innerHTML = errors+'<p>';
         temp.select();
         temp.focus();
       }
    }
   // till here additions of varma
   
	if( document.costReportForm.selectedReportType.value == 'CumulativeCostInformation' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Cumulative_Cost_Report.rpt";
	}

	if( document.costReportForm.selectedReportType.value == 'StandardCostReport' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/std_cost_info_report.rpt";
	}
	if( document.costReportForm.selectedReportType.value == 'ActualCostReport' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/act_cost_info_report.rpt";	
	}

	if( document.costReportForm.selectedReportType.value == 'ActualandStandardCostComparisonReport' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Std_Vs_Act_Cost_Info_Report.rpt";	
	}

	if( document.costReportForm.selectedReportType.value == 'StandardYieldedCostReport' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Std_Yielded_UnitCost.rpt";
	}
	if( document.costReportForm.selectedReportType.value == 'StandardYieldedCostPieChart' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Std_Yield_Cost_Percentage.rpt";	
	}
	if( document.costReportForm.selectedReportType.value == 'VendorYieldedCostReport' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Vendor_Yielded_UnitCost.rpt";
	}
	if( document.costReportForm.selectedReportType.value == 'VendorYieldedCostPieChart' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Vendor_Yield_Cost_Percentage.rpt";
	}	
	if( document.costReportForm.selectedReportType.value == 'StandardAndYieldedCostComparison' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Std_Cost_Vs_Yielded_Cost.rpt";
	}	
	if( document.costReportForm.selectedReportType.value == 'VendorAndYieldedCostComparison' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Vendor_Cost_Vs_Yielded_Cost.rpt";
	}	
	if( document.costReportForm.selectedReportType.value == 'StandardAndVendorYieldedCostComparisonChart' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Std_Vs_Vendor_Yielded_Cost.rpt";
	}	
	if( document.costReportForm.selectedReportType.value == 'StandardandVendorCostComparisonLineChart' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/Std_Vs_Vendor_Unit_and_Yielded_Cost.rpt";
	}	
	if( document.costReportForm.selectedReportType.value == 'StandardandVendorCostComparisonLineChartForEachStage' )
	{
		document.costReportForm.action="<%=chipTracContext%>/jsp/report.jsp?nameReport=Finance/Cost/All_Stages_Std_Vendor_Unit_Yielded_Cost.rpt";
	}

   // document.costReportForm.submit();
   //added by varma(29 jun 2004)
	if(errors == '')
	{
		document.costReportForm.submit();
	}
}

</script>


<TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<!-- Top Header Start-->

<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

<%@ include file="/jsp/finance/finance_reports_menu.jsp" %>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->

<form name="costReportForm" method="post">


<center><span class="NArialW">Inventory Cost Reports</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>


<table border="0" width="95%" align=right class='NArialL' cellspacing=4>

	<tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
	<%--Added by varma(29 jun 2004) to display validation msg of dates --%>
    <tr>
    	<td  colspan="6" align="left" class='NArialL'><FONT face="Verdana" size="-5" id="errors" styleClass="NArialL" color='FF0000'></FONT></td>
    </tr>
	<tr>
		<td width="15%"><font class="NArialL">Product:</font></td>
		<td width="20%"><font class="NArialL">
			<select size="1" name="prompt0" class="txfield">
				<option value="">Select Any product</option>
           		<logic:iterate id="mktgPartNumberSelectList" name="mktgPartNumberSelectList">
				<logic:notEqual name="mktgPartNumberSelectList" value="null">
	 				<option value = <bean:write name="mktgPartNumberSelectList" property="marketingPartNo"/>>
	 				<bean:write name="mktgPartNumberSelectList" property="marketingPartNo"/>
	 				</option>
 				</logic:notEqual>
 				</logic:iterate>
	        </select>
		</td>
	
		<td colspan=3>&nbsp;</td>	
       	<td width="10%" colspan=4>&nbsp;</td>
	</tr>
    
	<tr>
      	<td width="15%"><font class="NArialL">Lots, From Date:<br>(mm/dd/yyyy)</font></td>
		<td width="20%"><font class="NArialL">
      		<input type="text" name="fromdate" size="20" class="txfield"></font>&nbsp;
  			<a href="javascript:openCalendar(document.costReportForm.fromdate)">
  			<img border="0" src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=18 width=18 onmouseover="window.status='Click to Select Date';return true" onmouseout="window.status='';return true"></a></td>
      	
      	<td width="10%">&nbsp;</td>
      	
      	<td width="13%"><font class="NArialL">To Date:<br>(mm/dd/yyyy)</font></td>
      	<td width="20%"><font class="NArialL">
      		<input type="text" name="todate" size="20" class="txfield"></font>&nbsp;
      		<a href="javascript:openCalendar(document.costReportForm.todate)">
  			<img border="0" src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=18 width=18 onmouseover="window.status='Click to Select Date';return true" onmouseout="window.status='';return true"></a>
  		</td>
  		
		<td width="10%">&nbsp;</td>
	</tr>
	
	<tr><td colspan=5><font class='NArialS'><font color='green'>[ Blank fields defaults to ALL ]</font></font></td></tr>

    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
    
	<!-- Step selection Start -->
    <tr><td colspan=5> 
    	Group the results by:&nbsp;&nbsp;
    	<input type="radio" name="groupBy" value="1">Day&nbsp;&nbsp;&nbsp;
		<input type="radio" name="groupBy" value="7" checked>Week&nbsp;&nbsp;&nbsp;
		<input type="radio" name="groupBy" value="30">Month&nbsp;&nbsp;&nbsp;
		<input type="radio" name="groupBy" value="120">Quarter

    </td></tr>
    <!-- Step selection End -->
    
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>

	<!-- Report Type Selection Start -->       
    <tr><td colspan=5><font color="#993333"><u>Please select a Report Type:</u></font></td></tr>

	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="CumulativeCostInformation">
    Cumulative Cost Information
    </td></tr>

	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="StandardCostReport">
    Standard Cost Report
    </td></tr>

	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="ActualCostReport">
    Actual Cost Report
    </td></tr>

	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="ActualandStandardCostComparisonReport">
    Actual and Standard Cost Comparison Report
    </td></tr>

	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="StandardYieldedCostReport">
    Standard Yielded Cost Report
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="reportType" value="StandardYieldedCostPieChart">
    Standard Yielded Cost Pie Chart
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="VendorYieldedCostReport">
    Vendor Yielded Cost Report
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="radio" name="reportType" value="VendorYieldedCostPieChart">
    Vendor Yielded Cost Pie Chart
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="reportType" value="StandardAndYieldedCostComparison">
    Standard And Yielded Cost Comparison
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="reportType" value="VendorAndYieldedCostComparison">
    Vendor And Yielded Cost Comparison
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="reportType" value="StandardAndVendorYieldedCostComparisonChart">
    Standard And Vendor Yielded Cost Comparison Chart
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="reportType" value="StandardandVendorCostComparisonLineChart">
    Standard and Vendor Cost Comparison Line Chart
    </td></tr>
    
	<tr><td colspan=5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="radio" name="reportType" value="StandardandVendorCostComparisonLineChartForEachStage">
    Standard and Vendor Cost Comparison Line Chart For Each Stage
    </td></tr>
	<!-- Report Type Selection End -->
	        
    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=50></td></tr>
    
	<tr>
      <td colspan=5 align=center><a href="javascript:finance();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" width="53" height="17" onmouseover="window.status='Click to Generate Inventory Cost Reports';return true" onmouseout="window.status='';return true" title="Click here to Generate Inventory Cost Reports"></a>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

      <%-- <a href="javascript:cancelAndGoBack();" onMouseOver="window.status='Click here to go back to Finance menu';return true" onMouseOut="window.status='';return true">
      <img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a> --%>
       <%--Modified by varma(29 jun 2004) --%>
      <a href="javascript:document.costReportForm.reset();"><img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border='0' onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset"></a>
      </td>
    </tr>

    <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=30></td></tr>

  </table>

<input type = "hidden" name = "prompt1" value = "0">
<input type = "hidden" name = "prompt2" value = "0">
<input type = "hidden" name = "prompt3" value = "0">
<input type = "hidden" name = "selectedReportType" value = "0">

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</form>
</BODY>
</HTML>
